package com.lxc.mapping;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

//自定义的包
import com.lxc.common.PathManagement;
public class Admin{
	private HttpServletRequest request;
	private HttpServletResponse response;
	public Admin(HttpServletRequest request,HttpServletResponse response){
		this.request = request;
		this.response = response;
	}
	
	public void responseAdminPage()throws IOException{
		response.setContentType("text/html;charset=utf-8");
		ServletOutputStream sOut = response.getOutputStream();
		FileInputStream fInput = new FileInputStream(PathManagement.getHtmlPath()+"\\admin.html");
		//以特定的编码读取：utf-8
		InputStreamReader isR = new InputStreamReader(fInput,"UTF-8");
		String fContent = " ";
		char temChar =' ';
		int temInt = -1;
		while((temInt = isR.read()) != -1){
			temChar = (char)temInt;
			fContent = fContent + temChar;
		}
		byte[] fContentBytes = fContent.getBytes("UTF-8");
		sOut.write(fContentBytes);
	}
	
}